package com.example.smartcity.utils;

import android.content.Context;
import android.content.SharedPreferences;
import com.example.smartcity.MyApp;

public class SPUtils {
    private static final String SP_NAME = "smart_city_sp";

    public static void putString(String key, String value) {
        SharedPreferences sp = MyApp.getContext()
                .getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
        sp.edit().putString(key, value).apply();
    }

    public static String getString(String key, String defValue) {
        SharedPreferences sp = MyApp.getContext()
                .getSharedPreferences(SP_NAME, Context.MODE_PRIVATE);
        return sp.getString(key, defValue);
    }
}